package com.hyz.webview;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.just.agentweb.AgentWeb;

import static com.hyz.webview.sonic.SonicJavaScriptInterface.PARAM_CLICK_TIME;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    Button btnUp,btnDown;
    Button btnUp2,btnDown2;
    Button btnUp3 , btnUp4;
    Button btnTt;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
    }

    private void initView() {
        btnUp = findViewById(R.id.btn_upload);
        btnDown = findViewById(R.id.btn_download);


        btnUp2 = findViewById(R.id.btn_upload2);
        btnDown2 = findViewById(R.id.btn_download2);

        btnUp3 = findViewById(R.id.btn_uoload3);
        btnUp4 = findViewById(R.id.btn_uoload4);
        btnTt = findViewById(R.id.btn_toutiao);

        btnUp.setOnClickListener(this);
        btnDown.setOnClickListener(this);
        btnUp2.setOnClickListener(this);
        btnDown2.setOnClickListener(this);
        btnUp3.setOnClickListener(this);
        btnUp4.setOnClickListener(this);
        btnTt.setOnClickListener(this);
    }


    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.btn_upload:
                startActivity(new Intent(this , BaseWebActivity.class));
                break;
            case R.id.btn_download:
                startActivity(new Intent(this , BaseWebActivity_Down.class));
                break;
            case R.id.btn_upload2:
                startActivity(new Intent(this , BrowserActivityUp.class));
                break;
            case R.id.btn_download2:
                startActivity(new Intent(this , BrowserActivityDown.class));
                break;
            case R.id.btn_uoload3:

                Intent intent = new Intent(this , BaseWebActivityPcms.class);
                intent.putExtra(PARAM_CLICK_TIME , System.currentTimeMillis());
                startActivity(intent);
                break;
            case R.id.btn_uoload4:
                startActivity(new Intent(this , FilechooserActivity.class));
                break;
            case R.id.btn_toutiao:
                startActivity(new Intent(this , BaseWebActivityTt.class));
                break;
                default:
                    break;
        }
    }
}
